<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Thong tin mon an</title>
<style type="text/css">
<!--
.style37 {
	color: #990000;
	font-weight: bold;
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: smaller;
}
.style41 {
	font-family: ISAdora;
	font-size: 20px;
	font-weight: bold;
	color: #FFFFFF;
}
.style44 {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: smaller; }
.style51 {font-family: Verdana, Arial, Helvetica, sans-serif; font-weight: bold; font-size: smaller; color: #FFFFFF; }
-->
</style>
</head>

<body>
<form action="Bai4_10.php" method="post" enctype="multipart/form-data" name="form1" id="form1">
  <table width="700" border="0" align="center" cellpadding="3" cellspacing="0" background="#E6D4C6">
    <tr bgcolor="#CFA372">
      <td colspan="3"><div align="center"><span class="style41">THÔNG TIN MÓN ĂN </span></div></td>
    </tr>
    <tr>
      <td width="236" rowspan="3" bgcolor="#E6D4C6"><div align="center" class="style44">
	  <?php
	  	if(isset($_FILES['file']['name']))
		{
			echo "<img src='image_gallery/".$_FILES['file']['name']."' width=250 height=250 />";	
		}
		else
			echo "<img src='image_gallery/1.jpg' width=250 height=250 />";
	  ?>
	  </div>
        <div align="center" class="style44">Chọn hình 
          món ăn:
          <input type="file" name="file" value="<?php echo $_FILES["file"]["name"];?>">
      </div></td>
      <td width="172" bgcolor="#FFFFFF"><span class="style37">Tên món ăn: </span></td>
      <td width="254" bgcolor="#FFFFFF"><span class="style44">
        <label>
        <input name="ten_mon" type="text" id="ten_mon" value="<?php echo $_POST["ten_mon"];?>">
        </label>
      </span></td>
    </tr>
    <tr>
      <td bgcolor="#E6D4C6"><span class="style44">Loại món:</span></td>
      <td bgcolor="#E6D4C6"><span class="style44">
        <label>
        <select name="loai" id="loai">
        <?php
			$file=fopen("mon.txt","r",1);
			while(!feof($file))
			{
				$noi_dung.=fgets($file);
			}
			fclose($file);
			$mang_loai=explode("/*",$noi_dung);
			$n=count($mang_loai);
			for($i=1;$i<$n;$i++)
			{
				$mang=explode("|",$mang_loai[$i]);
				echo "<option ";
				if($_POST['loai']==$mang[0])
					echo "selected='selected' ";
				echo "value='".$mang[0]."'>".$mang[1]."</option>";
			}
		?>
        </select>
        </label>
      </span></td>
    </tr>
    <tr>
      <td valign="top" bgcolor="#E6D4C6">
        <p class="style44">Cách chế biến:</p>      </td>
      <td valign="top" bgcolor="#E6D4C6">
	    <span class="style44">
	    <textarea name="che_bien" cols="35" rows="4" id="che_bien"><?php echo $_POST["che_bien"];?></textarea>
      </span></td>
    </tr>
    
    <tr>
      <td colspan="3" bgcolor="#E6D4C6"><label></label>
      <div align="center">
        <label>
        <input type="submit" name="Submit" value="Thêm món ăn">
        </label>
      </div></td>
    </tr>
  </table>
</form>

<p>
  <?php
  	
//code
  ?>
</p>
<table width="70%" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#CFA372" bgcolor="#E6D4C6">
	<tr><td bgcolor="#CFA372"><span class="style51">Danh mục món ăn</span></td>
	<td bgcolor="#CFA372"><span class="style51">Thông tin món ăn</span></td>
	</tr>
  <tr>
    <td width="31%" valign="top">
	//code	</td>
    <td width="69%">
	
	//code
	
	&nbsp;</td>
  </tr>
</table>
</body>
</html>
